package com.mobilesales.android.util;


import java.util.ArrayList;
import java.util.List;

import com.mobilesales.android.model.clients.Client;
import com.mobilesales.android.model.clients.ClientGroup;
import com.mobilesales.android.model.dictionary.Dictionary;
import com.mobilesales.android.model.employees.Employee;
import com.mobilesales.android.model.params.FieldType;
import com.mobilesales.android.model.params.Param;
import com.mobilesales.android.model.tasks.CyclicTask;
import com.mobilesales.android.model.tasks.Task;
import com.mobilesales.android.model.tasks.TaskStatus;
import com.mobilesales.android.model.tasks.TaskType;

public class Temp {

	public static Client getClient() {
		Client client = new Client();
		client.Id = 1;
		client.City = "Lorem ipsum";
		client.Name = "Lorem ipsum";
		client.Name2 = "Lorem ipsum";
		client.Group = new ClientGroup();
		client.Group.Name = "Lorem ipsum 2";
		client.Group.Id = 2;
		client.Nip = "Lorem ipsum";
		client.Street = "Lorem ipsum";
		client.Zipcode = "Lorem ipsum";
		client.City = "Lorem ipsum";
		client.Phone = "Lorem ipsum";
		client.Fax = "Lorem ipsum";
		client.Info = "Lorem ipsum";
		client.Info2 = "Lorem ipsum";
		client.Debts = 30.0;
		client.IsSupplier = true;
		client.Params = new Dictionary<Param,String>();
		Param p = new Param();
		p.DefaultValue = null;
		p.FieldType = FieldType.String;
		p.DisplayName = "Custom string";
		p.IsRequired = false;
		client.Params.addValue(p, null);
		p = new Param();
		p.DefaultValue = "True";
		p.FieldType = FieldType.Boolean;
		p.DisplayName = "Custom boolean";
		p.IsRequired = true;
		client.Params.addValue(p, "False");
		p = new Param();
		p.DefaultValue = "Kot;Pies";
		p.FieldType = FieldType.Dictionary;
		p.DisplayName = "Custom dict";
		p.IsRequired = false;
		client.Params.addValue(p, "Pies");
		return client;
	}
	
	public static Client[] getClients() {
		Client clnt2 = getClient();
		clnt2.Id = 2;
		return new Client[] { getClient(), clnt2 };
	}
	
	public static ClientGroup[] getGroups() {
		ClientGroup[] groups = new ClientGroup[2];
		ClientGroup group = new ClientGroup();
		group.Id = 1;
		group.Name = "Lorem ipsum";
		groups[0] = group;
		group = new ClientGroup();
		group.Id = 2;
		group.Name = "Lorem ipsum 2";
		groups[1] = group;
		return groups;
	}
	
	public static Param[] getParams() {
		Param[] result = new Param[3];
		Param p = new Param();
		p.DefaultValue = null;
		p.FieldType = FieldType.String;
		p.DisplayName = "Custom string";
		p.IsRequired = false;
		result[0] = p;
		p = new Param();
		p.DefaultValue = "True";
		p.FieldType = FieldType.Boolean;
		p.DisplayName = "Custom boolean";
		p.IsRequired = true;
		result[1] = p;
		p = new Param();
		p.DefaultValue = "Kot;Pies";
		p.FieldType = FieldType.Dictionary;
		p.DisplayName = "Custom dict";
		p.IsRequired = false;
		result[2] = p;
		return result;
	}

	public static CyclicTask[] getCyclicTasks() {
		CyclicTask tsk = new CyclicTask();
		tsk.TaskInterval = 2;
		tsk.StartTime = "2011-12-15 18:00";
		tsk.EndTime = "2011-12-15 20:00";
		tsk.TaskStatus = new TaskStatus();
		tsk.TaskStatus.Id = 1;
		tsk.TaskStatus.Name = "Nowe";
		tsk.TaskType = new TaskType();
		tsk.TaskType.Id = 1;
		tsk.TaskType.Name = "Wizyta u klienta";
		return new CyclicTask[] { tsk };
	}

	public static Task[] getTasks() {
		Task tsk = new Task();
		tsk.StartTime = "2011-12-15 15:00";
		tsk.EndTime = "2011-12-15 17:00";
		tsk.ClientId = 1;
		tsk.TaskStatus = new TaskStatus();
		tsk.TaskStatus.Id = 2;
		tsk.TaskStatus.Name = "Potwierdzone";
		tsk.TaskType = new TaskType();
		tsk.TaskType.Id = 2;
		tsk.TaskType.Name = "Spotkanie biznesowe";
		return new Task[] { tsk };
	}

	public static List<Employee> getEmployees() {
		ArrayList<Employee> list = new ArrayList<Employee>();
		Employee e = new Employee();
		e.Firstname = "Marek";
		e.Lastname = "Chmiel";
		e.Id = 1;
		list.add(e);
		return list;
	}

	public static List<TaskType> getTaskTypes() {
		ArrayList<TaskType> list = new ArrayList<TaskType>();
		TaskType t = new TaskType();
		t.Id = 1;
		t.Name = "Wizyta u klienta";
		list.add(t);
		t.Id = 2;
		t.Name = "Spotkanie biznesowe";
		list.add(t);
		return list;
	}

	public static List<TaskStatus> getTasksStatuses() {
		ArrayList<TaskStatus> list = new ArrayList<TaskStatus>();
		TaskStatus t = new TaskStatus();
		t.Id = 1;
		t.Name = "Nowe";	
		list.add(t);	
		t = new TaskStatus();
		t.Id = 2;
		t.Name = "Potwierdzone";
		list.add(t);
		return list;
	}
}
